Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLATFORM-1195]: rfc8414 compliance #185

Merged
merged 22 commits into from
Nov 21, 2023

Conversation

MaeIsBad
Copy link
Member

@MaeIsBad MaeIsBad commented Nov 2, 2023

https://prima-assicurazioni-spa.myjetbrains.com/youtrack/issue/PLATFORM-1195

This allows auth0_ex to be used with okta as well as auth0 🙂

@MaeIsBad MaeIsBad force-pushed the PLATFORM-1195/task/rfc8414-compliance branch 5 times, most recently from acc5086 to f08e24d Compare November 2, 2023 17:36
@MaeIsBad MaeIsBad marked this pull request as ready for review November 3, 2023 11:20
@MaeIsBad MaeIsBad requested a review from a team as a code owner November 3, 2023 11:20
Copy link
Contributor

@cottinisimone cottinisimone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job :). Just a little thing

url = metadata_url(base_url)
%HTTPoison.Response{status_code: status_code, body: meta_body} = Telepoison.get!(url, accept: "application/json")

true = status_code in 200..299
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would handle it in a more graceful way since the error code might be a bit confusing from the user perspective. I think we might custom panic this and the Telepoison.get! to give a more relevant information to the user

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover i think it might be better to call this def fetch!(... being that this function might panic. Otherwise you can return {:ok, __MODULE__.t()} | {:error, atom() | String.t()} and gracefully handle panics

Copy link
Member Author

@MaeIsBad MaeIsBad Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to fetch! and added an exception. I think panicking in this situation makes sense

cpiemontese
cpiemontese previously approved these changes Nov 3, 2023
Copy link
Contributor

@cpiemontese cpiemontese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't retrieve_token on the hot path? 🤔

Anyways, nice!

@MaeIsBad
Copy link
Member Author

MaeIsBad commented Nov 6, 2023

Isn't retrieve_token on the hot path? 🤔

good point, I assumed it would get cached in redis, I'm not sure if the extra request is worth it

@MaeIsBad
Copy link
Member Author

MaeIsBad commented Nov 6, 2023

Isn't retrieve_token on the hot path? 🤔

I didn't think about it but it totally is if you don't configure redis.

Maybe if redis isn't configured we could use an ets cache by default?

@cpiemontese
Copy link
Contributor

Either ETS or an Agent, but maybe this could be done as part of a separate PR; the ability to cache locally if Redis is not available seems useful

@MaeIsBad MaeIsBad force-pushed the PLATFORM-1195/task/rfc8414-compliance branch from 9bbcf25 to 929c4e4 Compare November 20, 2023 14:51
@MaeIsBad MaeIsBad force-pushed the PLATFORM-1195/task/rfc8414-compliance branch 14 times, most recently from 34584ad to dce464c Compare November 20, 2023 17:56
@MaeIsBad MaeIsBad force-pushed the PLATFORM-1195/task/rfc8414-compliance branch from dce464c to 201079f Compare November 20, 2023 17:56
Copy link
Contributor

@cpiemontese cpiemontese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@MaeIsBad MaeIsBad merged commit 8ba0336 into master Nov 21, 2023
3 checks passed
@MaeIsBad MaeIsBad deleted the PLATFORM-1195/task/rfc8414-compliance branch November 21, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants